<template>
  <div class="page-content" style="padding-top: 0px; !important">
    <iframe :src="`/pdfjs/web/viewer.html?file=${path}`"
            style="border:0px !important;margin-top: 2px;"
            width="100%"
            height="100%">
    </iframe>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        path: ""
      }
    },
    methods: {
      getPath() {
        let path = `http://${window.location.host}${process.env.VUE_APP_BASE_API}/attachment/open?attachmentId=${this.$attrs.attachmentId}`;
        //return `http://${window.location.host}${process.env.VUE_APP_BASE_API}/attachment/open?attachmentId=${this.$attrs.attachmentId}`;
        return encodeURIComponent(path);
      }
    },
    created() {
      this.path = this.getPath();
    }
  }
</script>

<style scoped>

</style>
